package cn.yunhe.dao.impl;

import cn.yunhe.dao.HouseDao;
import cn.yunhe.entity.House;
import org.hibernate.SessionFactory;
import org.springframework.orm.hibernate3.HibernateTemplate;
import org.springframework.stereotype.Repository;

import javax.annotation.Resource;
import java.util.List;
@Repository("houseDao")
public class HouseDaoImpl extends HibernateTemplate implements HouseDao {
    @Resource
    private SessionFactory sessionFactory;

    @Override
    public List<House> getAllList() {
        return find("from House");
    }



    @Override
    public SessionFactory getSessionFactory() {
        return sessionFactory;
    }

    @Override
    public void setSessionFactory(SessionFactory sessionFactory) {
        this.sessionFactory = sessionFactory;
    }
}
